//
//  AinvitiveListTableViewCell.m
//  Distributor
//
//  Created by 主事丫环 on 2019/5/14.
//  Copyright © 2019 主事丫环. All rights reserved.
//

#import "AinvitiveListTableViewCell.h"

@implementation AinvitiveListTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)refash:(AinvitivePersonModel *)model{
    if ([model.shop_image hasPrefix:@"http"]) {
        [self.myheaderImage sd_setImageWithURL:[NSURL URLWithString:model.shop_image] placeholderImage:defaultImg];
    }else{
        sdimg(self.myheaderImage, model.shop_image);
    }
    
    self.shopNameLB.text = [NSString stringWithFormat:@"%@",model.shop_name];
    self.timeLb.text = [NSString stringWithFormat:@"%@加入",[model.create_time substringToIndex:10]];
    self.contLb.text = [NSString stringWithFormat:@"%@",model.address];

    self.phone = [NSString stringWithFormat:@"%@",model.shop_phone];
    self.guanliyuanImage.hidden = YES;
    if ([model.level integerValue] == 2) {
        self.guanliyuanImage.hidden = NO;
    }
    
    
}
-(void)Brefash:(BinvitiveShopModel *)model{
    
    if ([model.img hasPrefix:@"http"]) {
        [self.myheaderImage sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:defaultImg];
    }else{
        sdimg(self.myheaderImage, model.img);
        
    }
    
    self.shopNameLB.text = [NSString stringWithFormat:@"%@",model.name];
    self.timeLb.text = [NSString stringWithFormat:@"%@加入",[model.create_time substringToIndex:10]];
    self.contLb.text = [NSString stringWithFormat:@"%@",model.address];
    
    self.phone = [NSString stringWithFormat:@"%@",model.phoen];
    self.guanliyuanImage.hidden = YES;

    
    
}
-(void)BPersonrefash:(BinvitivepersonModel *)model{
    
    if ([model.image_url hasPrefix:@"http"]) {
        [self.myheaderImage sd_setImageWithURL:[NSURL URLWithString:model.image_url] placeholderImage:[UIImage imageNamed:@"headernopng"]];
    }else{
        sdimg(self.myheaderImage, model.image_url);
    }
    if (strIsEmpty(model.image_url)) {
        self.myheaderImage.image = imgname(@"headernopng");
    }
    
    self.shopNameLB.text = [NSString stringWithFormat:@"%@",model.name];
    self.timeLb.text = [NSString stringWithFormat:@"%@加入",[model.create_time substringToIndex:10]];
    self.contLb.text = [NSString stringWithFormat:@"%@",model.address];
    
    self.phone = [NSString stringWithFormat:@"%@",model.phone];
    self.guanliyuanImage.hidden = YES;
    
}

- (IBAction)cellaction:(UIButton *)sender {
    
    [HFTools callMobilePhone:_phone];
    

}

@end
